﻿
Namespace LightSwitchApplication

    Public Class PatientRecord

        Private Sub Patient_Loaded(succeeded As Boolean)
            ' Write your code here.
            Me.SetDisplayNameFromEntity(Me.Patient)
        End Sub

        Private Sub Patient_Changed()
            ' Write your code here.
            Me.SetDisplayNameFromEntity(Me.Patient)
        End Sub

        Private Sub PatientRecord_Saved()
            ' Write your code here.
            Me.SetDisplayNameFromEntity(Me.Patient)
        End Sub

        Private Sub Prescription_Execute()
            ' Write your code here.
            Me.Application.ShowPatientMedicationDetails(Me.Patientpatientno)
        End Sub

        Private Sub PatientRecord_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
            ' Write your code here.
            Me.DisplayName = "Patient - " & Me.Patient.SummaryName
            If Me.Patient.photo Is Nothing Then
                Me.FindControl("photo").IsVisible = False
            End If

            If Not Me.Patient.Patient_More Is Nothing Then
                If Not Me.Patient.Patient_More.CautionNote Is Nothing Then
                    ShowMessageBox(Me.Patient.Patient_More.CautionNote, "Patient Alert", MessageBoxOption.Ok)
                End If
            End If

            Me.ScreenHeader = "Patient Record"
        End Sub

        Private Sub openPrenatalScreen_Execute()
            ' Write your code here.
            'Me.Application.ShowConsultationPreNatal(Me.Patientpatientno)
            Me.Application.ShowConsultPreNatal(Me.Patientpatientno)
        End Sub

        Private Sub testsMethod_Execute()
            ' Write your code here.
            Me.Application.ShowConsultationBloodPressure(Me.Patientpatientno)
        End Sub
    End Class

End Namespace
